package structure_结构性.filter_pattern_过滤器模式;

import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/07/9:57
 * @Description:
 */
public class Person {
	private String name;
	private String gender;
	private String maritalStatus;//婚姻状态

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getMaritalStatus() {
		return maritalStatus;
	}

	public void setMaritalStatus(String maritalStatus) {
		this.maritalStatus = maritalStatus;
	}

	public Person(String name, String gender, String maritalStatus) {
		this.name = name;
		this.gender = gender;
		this.maritalStatus = maritalStatus;
	}

	@Override public String toString() {
		return "Person{" +
				"name='" + name + '\'' +
				", gender='" + gender + '\'' +
				", maritalStatus='" + maritalStatus + '\'' +
				'}';
	}

	@Override public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Person)) {
			return false;
		}
		Person person = (Person) o;
		return name.equals(person.name) &&
				gender.equals(person.gender) &&
				maritalStatus.equals(person.maritalStatus);
	}

	@Override public int hashCode() {
		return Objects.hash(name, gender, maritalStatus);
	}
}
